package com.github.cyf.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.github.cyf.config.mp.AbstractBaseDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 权限信息表
 * </p>
 *
 * @author chenyifan
 * @since 2024-10-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_permission")
@ApiModel(value="Permission对象", description="权限信息表")
public class Permission extends AbstractBaseDO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "权限ID")
    @TableId("id")
    private Long id;

    @ApiModelProperty(value = "权限PID,一级权限为【root】")
    @TableField("pid")
    @NotNull(message = "权限父id不能为空")
    private Long pid;

    @ApiModelProperty(value = "权限名称")
    @TableField("permission_name")
    @NotBlank(message = "权限名称不能为空")
    private String permissionName;

    @ApiModelProperty(value = "权限值")
    @TableField("permission_value")
    @NotBlank(message = "权限值不能为空")
    private String permissionValue;

    @ApiModelProperty(value = "组件路径，类型为菜单时填写")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "权限类型1菜单2接口")
    @TableField("type")
    @NotNull(message = "权限类型不能为空")
    private Integer type;

    @ApiModelProperty(value = "菜单排序")
    @TableField("sort")
    @NotNull(message = "菜单排序不能为空")
    private Integer sort;

    @ApiModelProperty(value = "是否可用 0：禁用 1：正常（默认）")
    @TableField("enable")
    @NotNull(message = "是否可用不能为空")
    private Integer enable;

}
